package bhbt.controller.admin.member;


import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import bhbt.controller.core.BaseController;
import bhbt.service.MemberService;
import bhbt.taglib.pagetag.Pagination;
import bhbt.utils.MapUtil;






/**
 * Created by Administrator on 2016/3/25.
 */
@Controller

public class MemberNoActiveListController extends BaseController {
    @Resource
    private MemberService memberService;
   
   
    @RequestMapping("admin/member/memberNoActiveList.shtml")
    public String list(HttpServletRequest request) throws Exception{
        HashMap formMap = getParameterMap(request);
          
        
        formMap.put("where", " a.accountActive = 'F'");	//  时间查询
        formMap.put("pagination.orderBy "," a.registerDate desc");
        Pagination page = memberService.queryForPageList("memberForPage",formMap);
       
        request.setAttribute(Pagination.pageBeanName, page);
        
      
        return "admin/member/memberNoActiveList";
    }

     
    @RequestMapping("admin/member/memberNoActiveDelete.shtml")
    public String delete(HttpServletRequest request) throws Exception{
        Map formMap = getParameterMap(request);
        int id = MapUtil.getIntValue(formMap, "id");
        if(0 < id){
        	 
        	memberService.deleteOne(id);
        }
        return "redirect:memberNoActiveList.shtml";
       
    }
}
